package com.atguigu.gmall.pms.api;

import com.atguigu.gmall.common.bean.PageParamVo;
import com.atguigu.gmall.common.bean.ResponseVo;
import com.atguigu.gmall.pms.entity.*;
import com.atguigu.gmall.pms.vo.ItemAttrGroupVo;
import com.atguigu.gmall.pms.vo.ItemSaleAttrValuesVo;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.SpringQueryMap;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

import java.util.List;
import java.util.Map;


public interface GmallPmsApi {
    @GetMapping("pms/attrgroup/queryItemAttrGroupsBySpuId/{spuId}")
    public ResponseVo<List<ItemAttrGroupVo>> queryItemAttrGroupsBySpuId(@PathVariable("spuId") Long spuId);
    @GetMapping("pms/skuattrvalue/queryItemSaleJsonsBySpuId/{spuId}")
    public ResponseVo<String> queryItemSaleJsonsBySpuId(@PathVariable("spuId")Long spuId);
    @GetMapping("pms/skuattrvalue/queryItemSkuAttrValueBySkuId/{skuId}")
    public ResponseVo<Map<Long,String>> queryItemSkuAttrValueBySkuId(@PathVariable("skuId")Long skuId);
    @GetMapping("pms/skuattrvalue/queryItemSkuAttrValuesBySpuId/{spuId}")
    public ResponseVo<List<ItemSaleAttrValuesVo>> queryItemSkuAttrValuesBySpuId(@PathVariable("spuId")Long spuId);
    @GetMapping("pms/spudesc/{spuId}")
    @ApiOperation("详情查询")
    public ResponseVo<SpuDescEntity> querySpuDescById(@PathVariable("spuId") Long spuId);
    //根据skuId查询sku图片集合
    @GetMapping("pms/skuimages/queryItemSkuImagesBySkuId/{skuId}")
    public ResponseVo<List<SkuImagesEntity>> queryItemSkuImagesBySkuId(@PathVariable("skuId")Long skuId);
    @GetMapping("pms/category/queryItemLevel123CatesByC3id/{c3id}")
    public ResponseVo<List<CategoryEntity>> queryItemLevel123CatesByC3id(@PathVariable("c3id")Long c3id);
    //根据skuid查询sku对象
    @GetMapping("pms/sku/{id}")
    public ResponseVo<SkuEntity> querySkuById(@PathVariable("id") Long id);
    //根据一级分类id查询二三级分类嵌套集合的接口
    @GetMapping("pms/category/queryCatesAndsSubs/{c1id}")
    public ResponseVo<List<CategoryEntity>> queryCatesAndsSubs(@PathVariable("c1id")Long c1id);
    //如果传入0代表查询所有的父分类
    @GetMapping("pms/category/parent/{id}")
    public ResponseVo<List<CategoryEntity>> queryCategoriesByParentId(@PathVariable("id") Long parentId);

    @GetMapping("pms/spu/{id}")
    public ResponseVo<SpuEntity> querySpuById(@PathVariable("id") Long id);

    @GetMapping("pms/skuattrvalue/sku/{skuId}")
    public ResponseVo<List<SkuAttrValueEntity>> querySkuAttrValuesBySkuId(@PathVariable("skuId") Long skuId);

    @GetMapping("pms/sku/spu/{spuId}")
    public ResponseVo<List<SkuEntity>> querySkusBySpuId(@PathVariable("spuId") Long spuId);

    @GetMapping("pms/spuattrvalue/spu/{spuId}")
    public ResponseVo<List<SpuAttrValueEntity>> querySpuAttreValuesBySpuId(@PathVariable("spuId") Long spuId);

    @GetMapping("pms/category/{id}")
    public ResponseVo<CategoryEntity> queryCategoryById(@PathVariable("id") Long id);

    @GetMapping("pms/brand/{id}")
    public ResponseVo<BrandEntity> queryBrandById(@PathVariable(value = "id", required = true) Long id);

    //如果feign客户端的方法形参使用了Pojo类型 feign认为参数需要以请求体的方式提交
    //就使用post方式提交远程访问的请求
    @GetMapping("pms/spu/page")
    public ResponseVo<List<SpuEntity>> querySpuPage(@SpringQueryMap PageParamVo paramVo);
}
